<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>修德抄经堂</title>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" type="text/css" href="../bower_components/mui/dist/css/mui.min.css">
	<link rel="stylesheet" type="text/css" href="../css/base.css">
	<link rel="stylesheet" type="text/css" href="../css/over.css">
	<link rel="stylesheet" type="text/css" href="../css/full.css">
	<link rel="stylesheet" type="text/css" href="../css/zhuchaoren.css">
	<script src="../bower_components/mui/dist/js/mui.min.js"></script>
	<script src="../bower_components/jquery/dist/jquery.js"></script>
</head>
<body>
	<div id="main" class="page">
	    <div id="top">
	    	<div class="content">
		    	<div class="people zhuchao">
		    		<div class="people_title">
		    			<h3 class="same">助抄人</h3>
		    		</div>
		    		<div class="people_desc">
		    			<!--<div class="name_wrap">-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    			<!--</div>-->
		    			<!--<div class="name_wrap">-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    			<!--</div>-->
		    			<!--<div class="name_wrap">-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    			<!--</div>-->
		    			<!--<div class="name_wrap">-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    			<!--</div>-->
		    			<!--<div class="name_wrap">-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    			<!--</div>-->
		    			<!--<div class="name_wrap">-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    			<!--</div>-->
		    			<!--<div class="name_wrap">-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    			<!--</div>-->
		    			<!--<div class="name_wrap">-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    				<!--<div><p class="fang">张某某</p></div>-->
		    			<!--</div>-->
		    		</div>
		    	</div>
		    	<div class="people yuanwen">
		    		<div class="people_title">
		    			<h3 class="same">发愿文</h3>
		    		</div>
		    		<div class="same yuanwenzi">愿过去佛，现在佛，未来佛，常说般若波罗蜜；愿一切受持者，比丘尼、信男、信女，所求如意，常行般若波罗蜜</div>
		    		<div class="same qianming">
		    			<p class="p1">信氏弟子</p>
		    			<p class="p2">
							<input type="text" placeholder="请签名" class="sign fang" id="qianming"/>
						</p>
		    			<p class="p3">丁酉年五月八日</p>
		    		</div>
		    	</div>
		    </div>
		    <!-- <div class="tingo">
				<div class="next">
		    		<div class="next_txt">
		    			<p class="same">查看发愿文</p>
		    		</div>
		    		<div class="next_pic">
		    			<img src="../img/bore/more.png" class="cover">
		    		</div>
		    	</div>
			</div> -->
	    </div>
		
		<!-- <div id="anniu">
			 <div id="shang">
				<img src="../img/benxin/next.png">
				<a class="color same">上一步</a>
			</div> 
			<div id="xia">
				<a class="color same">下一步</a>
				<img src="../img/benxin/you.png">
			</div>
		</div> -->

		<div class="button">
			<a id="setNext">
				<button class="cover">下一步</button>
			</a>
			<a id="finish" href="" style="display: none;">
				<button class="cover">完成</button>
			</a>
		</div>
	</div>
</body>
<script src="../js/common.js"></script>
<script src="../js/resLoader.js"></script>
<script>
	var lunarInfo=new Array(
			0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,
			0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,
			0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,
			0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,
			0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,
			0x06ca0,0x0b550,0x15355,0x04da0,0x0a5d0,0x14573,0x052d0,0x0a9a8,0x0e950,0x06aa0,
			0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,
			0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b5a0,0x195a6,
			0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,
			0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,
			0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,
			0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,
			0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,
			0x05aa0,0x076a3,0x096d0,0x04bd7,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,
			0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0)
	var Animals=new Array("鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪");
	var Gan=new Array("甲","乙","丙","丁","戊","己","庚","辛","壬","癸");
	var Zhi=new Array("子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥");
	var zhong = new Array("一","二","三","四","五","六","七","八","九","十","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十","二十一","二十二","二十三","二十四","二十五",
	"二十六","二十七","二十八","二十九","三十","三十一");
	var now = new Date();
	var SY = now.getYear();
	var SM = now.getMonth()+1;
	var SD = now.getDate();

	function cyclical(num) { return (Gan[num%10]+Zhi[num%12]) } //==== 传入 offset 传回干支, 0=甲子
	function change(dt)
	{
		var temp="";
		switch(dt)
		{
			case "1": temp="一";
				break;
			case "2": temp="二";
				break;
			case "3": temp="三";
				break;
			case "4": temp="四";
				break;
			case "5": temp="五";
				break;
			case "6": temp="六";
				break;
			case "7": temp="七";
				break;
			case "8": temp="八";
				break;
			case "9": temp="九";
				break;
			default:temp="零";
		}
		return temp;
	}
	$('.yuanwen .p3').text(change(SY.toString().substring(1,2))+change(SY.toString().substring(2,3))+"年"+change(SM.toString())+"月"+zhong[SD-1]+"日");
//	function showDate()
//	{
//		var now=new Date();
//		var year=now.getYear();
//		var mm = now.getMonth()+1;
//		var yy=change(year.toString().substring(1,2))+change(year.toString().substring(2,3));
//		mm = change(mm);
//		alert("当前日期: 公元"+mm+"年"+);
//	}
//	showDate();
</script>
<script>
	$(function () {
	    var vId = getUrlParam('id');
        $('#finish').attr("href",'./wancheng.html?id='+vId);
		$.ajax({
			url: '/fe/transcript/user_transcription/'+vId+'/vow',
			success: function (data) {
				console.log(data);
				var text = data.data.vow_text;
				$('.yuanwenzi').text(text);
            }

		});
        $(".sign").focus();

        $(".sign").focus(function(){

            $(this).removeClass('box');
        });

        $(".sign").blur(function(){

            $(this).addClass('box');
        });
        function getCookie(name) {
            var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
            if (arr != null) return unescape(arr[2]);
            return null;
        }
        $('#setNext .cover').click(function () {
            var qianming = $('#qianming').val();
            console.log(qianming)
            if(qianming == '') {
                alert('请输入您的名字');
            }else {
                $(this).hide();
                var csrftoken = getCookie('csrftoken');
                $.ajax({
                    url: '/fe/transcript/user_transcription/'+vId+'/finish',
                    type: 'POST',
                    beforeSend: function(xhr, settings) {
                        xhr.setRequestHeader("X-CSRFToken", csrftoken);
                    },
                    data: {
                        "signature_text": qianming,
                    },
                    success: function (data) {
                        console.log(data);
                        var text= '';
                        var data = data.data.assistants;
						for(var i=0;i<data.length;i++){
						    if (i%4==0){
						        text = text + '<div class="name_wrap">'
							}
                            text = text + '<div><p class="fang">'+data[i].name+'</p></div>'
							if (i%3==0 && i!=0){
						        text = text + '</div>'
							}
						}
						$('.people_desc').empty().append(text);
                    }
                });
                $('#finish').show();
                $('.yuanwen').hide();
                $('.zhuchao').show();
            }
        })
    })




</script>
</html>